package com.techprimers.mybatis.springbootmybatis.mapper;

import com.techprimers.mybatis.springbootmybatis.model.Post;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PostMapper {

    // select * from bbs_post where content like '%男人%' limit 10;
    // @Select("select * from bbs_post where content like '%#{contentName}%' limit 10")
    @Select("select * from bbs_post limit 10")
    public List<Post> findAll();

    @Select("select * from bbs_post where content like '%${name}%'  limit 10")
    public List<Post> findByContent(@Param("name") String contentName2);
}
